<%@ page import="bid.entity.Professor" %>
<%@ page import="java.util.List" %>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>Title</title>
</head>
<body>
  <%
      List<Professor> ps= (List<Professor>) request.getAttribute("professors");
      Long pageNums= (Long) request.getAttribute("pages");//总页数
      Integer pageNo= (Integer) request.getAttribute("pageNo");//总页数
  %>
  <table border="1" cellpadding="0" cellspacing="0">
      <tr>
          <th>编号</th>
          <th>姓名</th>
          <th>手机</th>
          <th>操作</th>
      </tr>
      <%
          for (Professor p : ps) {
      %>
      <tr>
          <td><%=p.getId()%>
          </td>
          <td><%=p.getProfessorName()%>
          </td>
          <td><%=p.getPhone()%>
          </td>
          <td>
              <a onclick="return confirm('真的要删除码？')" href="#">删除</a>
              <a href="#">修改</a>
          </td>
      </tr>
      <%}%>
  </table>
  <p style="text-align: center">
      <a href="professor?pageNo=1">第一页</a>
      <%
          if(pageNo>1){
      %>
      <a href="professor?pageNo=<%=pageNo-1%>">上一页</a>
      <%}%>
      <input style="width:40px" value="<%=pageNo%>"  type="number" id="go" name="goto" min="1" max="<%=pageNums%>"/>
      <input type="button" value="Go" onclick="gotoPage()"/>
      <%
          if(pageNo<pageNums){
      %>
      <a href="professor?pageNo=<%=pageNo+1%>">下一页</a>
      <%}%>
      <a href="professor?pageNo=<%=pageNums%>">最后一页</a>
  </p>
</body>
</html>
